<template>
  <div class="venus-list-page">
    <div class="page-search">
      <el-row type="flex" class="search-list">
        <el-row type="flex" class="list-items">
          <div class="venus-input-box">
            <label>债券代码</label>
            <el-input
              v-model="table.deal_info_table.ftool_code"
              class="venus-input-middle"
              placeholder="请输入债券代码"
            />
          </div>
          <div class="venus-input-box">
            <label>行权日期</label>
            <el-date-picker
              v-model="table.deal_info_table.start_date"
              type="date"
              class="venus-input-middle venus-input-date"
              placeholder="请选择起始日期"
              value-format="yyyyMMdd"
            />-
            <el-date-picker
              v-model="table.deal_info_table.end_date"
              type="date"
              class="venus-input-middle venus-input-date"
              placeholder="请选择结束日期"
              value-format="yyyyMMdd"
            />
          </div>
        </el-row>
        <div class="venus-btn-box">
          <el-button type="primary" @click="search">查询</el-button>
          <el-button type="primary" @click="">重置</el-button>
        </div>
      </el-row>
    </div>
    <!--    查询列表返显-->
    <div class="page-list">
      <el-row type="flex" justify="space-between" class="page-list-head">
        <div class="title">查询结果</div>
      </el-row>
      <table-pagination
        :dict-data="dict"
        :table-data="table.deal_info_table.tableData"
        :table-header-config="table.tableHeaderConfig"
        highlight-current-row
        :total="table.deal_info_table.total"
        :page-size="table.deal_info_table.limit"
        :now-page="table.deal_info_table.nowPage"
        @current-change="currentChange"
        :operation-config="table.operationConfig"
      />
    </div>

    <el-dialog :title="dialog.xq.title" :visible.sync="dialog.xq.formVisible">
      <!-- ref=dlgForm用于验证表单 -->
      <el-form ref="xqlog" :model="dialog.form" size="mini">
        <el-row>
          <el-col :xs="24" :sm="12" :md="12">
            <el-form-item
              label="资产类别"
              :label-width="dialog.formLabelWidth"
              prop="ad_name"
              :rules="dialog.formRules.ad_name"
            >
              <el-input v-model="dialog.form.ad_name"
              />
            </el-form-item>
          </el-col>

        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer" style="text-align: center">
        <el-button type="success" @click="">确 定</el-button>
        <el-button type="info" plain @click="dialog.assdeptType.formVisible=false">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
  import * as kk from '../../../../../utils/k-utils'
  import request from '../../../../../utils/request'
  export default {
    name: 'M8223',
    data() { // 数据定义
      return {
        /*查询部分数据*/
        dict:{
          cbcTypeItems: {}, // 资产一级分类

        },
        /* 表格部分数据 */
        table: {
          tableHeaderConfig: [ // 表头配置
            {prop: 'ftool_code', label: '债券代码'},
            {prop: 'ftool_name', label: '债券名称'},
            {prop: 'port_name', label: '产品组合'},
            {prop: 'prod_name', label: '理财产品'},
            {prop: 'account_type', label: '会计分类'},
            {prop: 'positionbln', label: '持仓面额(万元)'},
            {prop: 'bond_market', label: '债券市场'},
            {prop: 'exercise_date', label: '行权日期'}
          ],
          operationConfig: { // 表格操作配置
            fixed: 'right',
            width: 200,
            operationButton: [
              // 每一个操作。value:操作文字；func:回调函数
              {value: '行权', func: this.myXq},
              {value: '详情', func: this.myInfo}
            ]
          },
          deal_info_table:{ //表格数据
            total: 0,
            nowPage: 1,
            limit : 5,
            tableData: [], // 表格数据
            exeid:'M8223AEQ111',//exeid
            ftool_code: '', // 模板名称
            start_date: '', // 起始日期
            end_date: '', // 结束日期
            market_code: 3
          }
        },
        dialog: {
          formLabelWidth: '100px',
          formRules: {
          },
          form: {
            ad_name: '', // 资产类别

          },
          xq: {
            title: '债券行权交易',
            dlgFormDisabled: false,
            formVisible: false,
          }
        },
      }
    },
    mounted() {
      // 初始化调用
      this.init()
    },
    methods: {
      init:function(){

      },
      search(index){
        this.table.deal_info_table.nowPage=1;
        kk.k_load_table(this,'deal_info_table','bond');
      },
      myXq(index){
        this.dialog.xq.formVisible = true
      },
      myInfo(index){

      },
      //下一页触发的事件
      currentChange(index){
        this.table.deal_info_table.nowPage=index;
        kk.k_load_table(this,'deal_info_table','bond');
      },
    }
  }
</script>

<style scoped>
</style>
